<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>融易拍</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />

    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css" />
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css" />

    <link rel="stylesheet" href="/static/wx/css/reset.css" />
    <link rel="stylesheet" href="/static/wx/css/main.css" />
    <link rel="stylesheet" href="/static/wx/css/public_main.css" />
  </head>

  <body>
    <div class="page-group">
      <div class="page page-current" id="saler">
        <!-- 标题栏 -->
        <!-- <header class="bar bar-nav"> -->
        <!--
          <a class="icon pull-left">
              <img src="imgs/icon/left.png" width="15" height="25">
          </a>
        -->
        <!-- <h1 class="title">融易拍</h1> -->
        <!-- </header> -->
        <!-- 工具栏 -->
        <nav class="bar bar-tab">
          <a class="tab-item external active" href="">
            <img class="icon" src="/static/wx/imgs/img/home_active.png" />
            <span class="tab-label">首页</span>
          </a>
          <!--
            <a class="tab-item external" href="about.html">
                <img class="icon" src="imgs/img/luru.png">
                <span class="tab-label">录入</span>
            </a>
          -->
          <a class="tab-item external" href="{:url('message/getMessList')}">
            <img class="icon" src="/static/wx/imgs/img/message.png" />
            <span class="tab-label">消息</span>
            <span class="badge"></span>
          </a>
          <a class="tab-item external" href="{:url('User/person')}">
            <img class="icon" src="/static/wx/imgs/icon/mine.png" />
            <span class="tab-label">我的</span>
          </a>
        </nav>
        <!-- 主内容 -->
        <div class="content">
          <div class="avator-box">
            <div class="avator-inner">
              <div class="avator"><img src="{$user.head_img}" /></div>
              <p class="avator-name size-n">{$user.username}</p>
              <p class="avator-company size-m">{$user.company_name}</p>
            </div>
            <div class='type-icon'>业务员</div>
          </div>
          <div class="buttons-tab">
            <a href="#tab1" class="tab-link {if($type==1)}active{/if} button size-m" id="type1">保险公司录入</a>
            <a href="#tab2" class="tab-link {if($type==2)}active{/if} button size-m" id="type2">物权人录入</a>
          </div>
          <div class="tabs">
            <div id="tab1" class="tab active">
              <div class="native-scroll">
                <div class="list-block">
                  <ul>
                    {foreach($info as $k=>$v)}
                    <li>
                      <a href="{:url('SaleMan/get_info',['policy_num'=>$v.policy_num,'type'=>$type])}" class="item-link item-content external">
                        <div class="item-inner">
                          <div class="item-title">
                            <div class="title-num size-m">
                              报案号：{$v.policy_num}
                            </div>
                            <div class="time size-m">{$v.created_at}</div>
                          </div>
                          <div class="status size-m">{$v.status_name}</div>
                        </div>
                      </a>
                    </li>
                    {/foreach}
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <script
      type="text/javascript"
      src="/static/wx/lib/sui/zepto.min.js"
      charset="utf-8"
    ></script>
    <script
      type="text/javascript"
      src="/static/wx/lib/sui/sm.min.js"
      charset="utf-8"
    ></script>
    <script
      type="text/javascript"
      src="/static/wx/lib/sui/sm-extend.min.js"
      charset="utf-8"
    ></script>
  </body>
</html>
<script>
  $('#type1').on('touchend',function () {
      window.location.href='/wx/SaleMan/index?type=1';
  });
  $('#type2').on('touchend',function () {
      window.location.href='/wx/SaleMan/index?type=2';
  });

  function checkMsg(){
      var html = '';
      $.ajax({
          url:'/wx/index/check_msg',
          type:'post',
          dataType:'json',
          data:{},
          success:function (data) {
              if(data.code ==200){
                  if(data.data > 0){
                      html = data.data;
                  }else{
                      html = '暂无';
                  }
                  $('.badge').html(html);
              }else{
                  $.alert(data.msg);
              }
          }
      });
  }
  setInterval('checkMsg()',2000);

</script>